package zz;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JComboBox;

public class ComboBoxDemo  extends JComboBox implements ActionListener{
	public ComboBoxDemo()
	{
		this.addItem( "Lab");this.addItem( "Lab 2");
	}
	  public void actionPerformed(ActionEvent e) {
	        JComboBox cb = (JComboBox)e.getSource();
	        String petName = (String)cb.getSelectedItem();
	        System.out.println("aa"+petName);
	    }
}
